home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 096 / strew.arc / STREW.DOC < prev    next >
Encoding:
Text File  |  1984-09-30  |  38.6 KB  |  765 lines

  1.  
  2.                                    STREW    
  3.  
  4.                             A full screen editor...
  5.                             A file separator...
  6.                             A file extractor...
  7.                             A file reformater...
  8.                             An RBBS upload manager...
  9.  
  10.                          Version 1.1.  SEPTEMBER 28, 1984.
  11.  
  12.                                Copyright (c) 1984
  13.  
  14.                                   Ken Goosens
  15.                               5020 Portsmouth Road
  16.                               Fairfax, VA 22032
  17.  
  18.  
  19.  
  20.      TABLE OF CONTENTS
  21.  
  22.  
  23.      Conditions of Use...............................................
  24.  
  25.      What STREW Does.................................................
  26.  
  27.      A Quick Tutorial................................................
  28.  
  29.      Limitations.....................................................
  30.  
  31.      Installation....................................................
  32.  
  33.      Running STREW...................................................
  34.  
  35.      How STREW Normally Works........................................
  36.  
  37.      Configuring STREW...............................................
  38.  
  39.      General Strew Configuration.....................................
  40.  
  41.      RBBS Configuration..............................................
  42.  
  43.      Editing Commands................................................
  44.  
  45.      Using Strew with RBBS...........................................
  46.  
  47.      Modifying STREW.................................................
  48.  
  49.  
  50.      CONDITIONS OF USE
  51.  
  52.      You are free to use and distribute this program provided
  53.  
  54.           (a) the copyright notice is not altered or removed.
  55.           (b) nothing is charged for its distribution.
  56.  
  57.      If you make any fixes to STREW, please send them to the author in
  58.      a form of a documented merge file so that they can be incorporated
  59.      into an official version and distributed to other users.  Suggestions
  60.      for enhancements will also be appreciated and probably be implemented.
  61.      The author does support this program, so please report any problems
  62.      you have with the program or the documentation.  The author can be
  63.      reached on the following public bulletin board number: 202-537-7475.
  64.  
  65.      No warranty is implied with this program.  Any user takes full respons-
  66.      ibility for its use.
  67.  
  68.      There are seven files with this system.
  69.  
  70.      STREW.BAS   -  Source code.  Written in Microsoft BASIC for IBM PC
  71.      STREW.DOC   -  Documentation (this document)
  72.      STREW.EXE   -  Compiled version.  Uses IBM's BASIC compiler
  73.      QPRINT.BIN  -  Assembler program for use with interpreter
  74.      QPRINT.OBJ  -  Assembler program for use with compiled version
  75.      EXAMPLE.STW -  Example of a configuration file
  76.      PLAN.DAT    -  Example of a data file to be strewed (see tutorial)
  77.  
  78.      STREW is written in IBM Basic and has been tested by its author only
  79.      on the IBM PC under DOS 2.1.  It should run on all IBM PCs and compat-
  80.      ibles, however.  BASIC was chosen so that the user community could
  81.      modify and improve the product.
  82.  
  83.  
  84.      WHAT STREW DOES
  85.  
  86.      STREW.BAS is a different kind of full screen editor.  It combines
  87.      elements of text editors, data base managers, and spreadsheets.
  88.      It differs significantly from other editors in several respects.
  89.  
  90.          MOST OTHER EDITORS                     STREW
  91.  
  92.      Lines saved to same file          Lines saved to same or different
  93.  
  94.      A line saved to one file          A line saved to one or more
  95.  
  96.      Line is variable length record    Divided into fixed length fields
  97.  
  98.      Reads all files same way          Specify how each file to be read
  99.  
  100.      Read in entire file               Select columns to read in
  101.  
  102.      Displays line as is               Separates fields with spaces
  103.  
  104.      No labels                         Labels the columns
  105.  
  106.      Saves file in one format          Specify field and record separators,
  107.                                        whether field quoted
  108.  
  109.      Saves only as seen on screen      User controls order fields written
  110.  
  111.      Reads only lines < 256 chars      Unlimited line length on read
  112.  
  113.      Stores only line < 256 chars      Stores to 7901 chars from a line
  114.  
  115.      Runs interactively only           Interactive or batch
  116.  
  117.      (1)     Other  editors force all lines being saved to go into the same
  118.      file.  STREW relaxes this assumption:   not  only  can  each  line  be
  119.      saved  to a different file, but the same line can be saved to multiple
  120.      files.  STREW will therefore "strew" the lines  in  a  file  to  other
  121.      files.
  122.  
  123.      (2)   Other editors treat your lines as one continuous variable length
  124.      record.  STREW treats your  input  record  as  discrete  fixed  length
  125.      fields,  The  operational  differences are that STREW will not let you
  126.      lengthen a field, and when a field is shortened, STREW will not  close
  127.      up the text by drawing characters from fields to the right.
  128.  
  129.      (3)     Other  editors  read  in all of your input file.  STREW allows
  130.      you to specify which columns in  the  input  file  you  want  to  get.
  131.      STREW  can  therefore  selectively  extract  the pertinent part of the
  132.      data that is needed.
  133.  
  134.      (4)   Other editors display  your  text  as  one  continuous  variable
  135.      length  string.   STREW  displays  the text in fields of fixed length,
  136.      with spaces between the fields, in a column with a  label:  much  like
  137.      a spreadsheet.  (STREW has horizontal scrolling.)
  138.  
  139.      (5)     Most  other  editors save your file in one format only.  STREW
  140.      allows the data to be saved in different formats.  The options include:
  141.      (a) whether the records are  fixed  length  or  variable  length,  (b)
  142.      what  the  separator between fields is, (c) what the separator between
  143.      records is, (d) what fields, if  any,  are  to  have  quotes  inserted
  144.      around  them,  and  (e)  in  what order the displayed fields are to be
  145.      written out.
  146.  
  147.      (6)   Other editors are limited in the length of lines they  can  read
  148.      and  store.   Usually  the  limit  is  between 132 and 255 characters.
  149.      STREW can read through a  line  of  any  length  whatsoever,  although
  150.      it  cannot  store  all  of  the information.  It will store up to 7901
  151.      characters (99 x 80) of information from a line for editing and saving.
  152.  
  153.      (7)   Most editors can  be  run  interactively  only.   By  specifying
  154.      that  the  maximum  number  of  lines on the screen is zero, strew can
  155.      be run as a batch program.  This is primarily useful if all  you  want
  156.      to  do  is  to  reformat  a file or to separate out lines in a file by
  157.      a field in the file.
  158.  
  159.      STREW therefore does the following types of tasks uniquely well  among
  160.      text editors.
  161.  
  162.           (1)   Splitting out lines in a file.
  163.  
  164.           (2)   Displaying and editing fixed length records.
  165.  
  166.           (3)   Reformating files with fixed length records.
  167.  
  168.           (4)   Extracting only needed fields.
  169.  
  170.      STREW  also  has  a  specially configured option called "RBBS" for use
  171.      with the Remote Bulletin Board System (RBBS).  It allows the  operator
  172.      of  the  host  system  to  review the list of uploaded files, edit the
  173.      entries, and specify what other  directory  files  the  lines  in  the
  174.      uploaded  list  are  to  be  appended  to.  This utility makes it very
  175.      easy to manage uploaded files.
  176.  
  177.      STREW is especially useful for formatting mainframe  files  downloaded
  178.      to a PC.  For example, STREW can be easily used to
  179.  
  180.           (1)  Add  spaces  between  fields  so  that  the file can be read
  181.                into 123.
  182.  
  183.           (2)  Reorder fields.  For example, if a date comes down in MMDDYY
  184.                format  and  you  need  it in YYMMDD, just read in each part
  185.                as a separate field and change the order in which the fields
  186.                are written out.
  187.  
  188.           (3)  Convert a fixed length file to a comma separated file.
  189.  
  190.           (4)  Extract only needed fields from a large record.
  191.  
  192.           (5)  Break  up  the  fields into discretely displayed and labeled
  193.                columns,  making it each  to  spot  check  downloaded  files
  194.                of any size to see whether the information is as expected.
  195.  
  196.  
  197.      A QUICK TUTORIAL
  198.  
  199.      You  need  to  work  with some data residing on the mainframe.  A dump
  200.      of the file has been prepared  for  you,  which  you  have  downloaded
  201.      to  disk.   Like  many  mainframe  files,  the data is stored in fixed
  202.      length fields.  The layout is as follows.
  203.  
  204.                         meaning      length  data type
  205.  
  206.                       cost center       3      text
  207.                          level          2      text
  208.                          number         2      numeric
  209.                          title         16      text
  210.                      min salary         6      numeric
  211.                      max salary         6      numeric
  212.  
  213.      Each record consists of  information  about  planned  staffing  levels
  214.      by  cost  center  in  a corporation, and includes the cost center, the
  215.      level of a position, the number of positions at  that  level  in  that
  216.      cost  center,  the  title  of  the position, and a minimum and maximum
  217.      salary level for that position.
  218.  
  219.      The data is stored in file PLAN.DAT.  You need  to  do  three  things:
  220.      visually  check the data,  reformat the data so that a space separates
  221.      the fields and the text fields are put in quotes so  that  it  can  be
  222.      read into a spreadsheet, and to split out the data by cost center.
  223.  
  224.      The  first  thing  you  need  to  do is to create a configuration file
  225.      for PLAN.DAT.  At DOS type "STREW<rtn>"  and  the  select  option  "C"
  226.      for  "configure"  by  entering  "C<rtn>".   The "<rtn>" means to press
  227.      the enter key.  You will  be  prompted  for  the  file  to  configure.
  228.      Respond  "PLAN<rtn>".   Then  you  will be asked if you want to create
  229.      the new configuration file by editing a previous one.  Type  "EXAMPLE"
  230.      to  use  the  configuration  provided  with  STREW.  This will be read
  231.      in and displayed on the screen.  For now we will just use  this  file.
  232.      Press  Escape  to  indicate  that  you have made all changes you want.
  233.      You will then be prompted whether you want to change  the  record  and
  234.      field  separators used for output.  Press <rtn> to indicate no change.
  235.      You will then get a final chance to reedit the screen you have entered
  236.      or  to  confirm  it is right.  Press <rtn> to indicate that the screen
  237.      is to saved as displayed.
  238.  
  239.      You will then get a second screen of configuration parameters.   Press
  240.      Escape  to indicate you are done making changes, then <rtn> to confirm
  241.      that the screen is to be  saved  in  the  configuration  file.   STREW
  242.      will  then  report  that  it  is saving the file and return you to the
  243.      main menu.  Here select option S by entering "S<rtn>" and then respond
  244.      "PLAN.DAT<rtn>"  for  the  file  to  strew.   STREW will then read the
  245.      file and display it according to your spefication.  Notice  how  STREW
  246.      labels  the  fields  in  the  file  and displays them in a format easy
  247.      to read.  Press Escape to indicate  that  you  are  done  editing  the
  248.      file.  Then do not save the file; abort by pressing "A<rtn>".
  249.  
  250.      Now  go  back  and  reconfigure  PLAN.DAT.  Change the field separater
  251.      from nothing to space.  Indicate you want to change the field separator;
  252.      then you will be prompted for how many characters are in the separator.
  253.      Indicate 1.  Then you will be prompted to type the  character:   press
  254.      the  space  bar.   Do  not change the record separator.  On the second
  255.      screen of parameters  change  the  column  labeled  "QUOTE?" from  "N"
  256.      to  "Y"  for  rows  1,2,  and 4 (the three text fields).  After saving
  257.      the configuration, strew PLAN.DAT; only  this  time  really  strew  it
  258.      instead  of  aborting.   After  strewing, select "Q" for quit.  At DOS
  259.      then do "TYPE PLAN.DAT<rtn>" and then "TYPE CC1".  Note how CC1 inserted
  260.      a space between the fields in PLAN.DAT,  and  quotes  are  around  the
  261.      right fields.
  262.  
  263.      Now  you want to split PLAN.DAT according to cost center.  To do this,
  264.      change the configuration to indicate that  the  STREW  field  will  be
  265.      read  from  the  file,  save  it,  and then strew PLAN.DAT again.  Now
  266.      the file will be strewed to CC011, CC040, and CC090.  Type  each  file
  267.      at  DOS  to  confirm  that  the records in each file are for the right
  268.      cost center.
  269.  
  270.  
  271.      LIMITATIONS
  272.  
  273.      STREW can edit up to 99 fields.  A field must fit on  the  screen  and
  274.      therefore  cannot  be  more  than  80 characters.  Up to 99 horizontal
  275.      screens can be associated with a file.  The maximum  number  of  lines
  276.      or  rows  that  STREW  can  display will depend on how many columns or
  277.      fields there are.  STREW stores the fields in arrays, and  dynamically
  278.      allocates  whatever  space it has left to rows.  In its current state,
  279.      1800 slots are left open, so that 10 fields can have up to  180  rows,
  280.      and 4 fields has a maximum of 450 rows.
  281.  
  282.      Strew  accepts  as  input  files  only  those where the fields read in
  283.      are in a fixed position in each record.  However,  fields  beyond  the
  284.      last  one  read  in  can  have  any length, including variable length.
  285.      The input file needs to be fixed length up  to  the  last  field  read
  286.      in.
  287.  
  288.      Strew  can  read  only  files where the records have a carriage-return
  289.      line-feed as a delimiter.  However,  STREW  will  read  input  records
  290.      of any length.
  291.  
  292.      The  fields  to  be  read  in  are specified by beginning position and
  293.      length.  The fields read in cannot overlap.  For example,  you  cannot
  294.      specify  to read in both date in columns 8-12 and also year in columns
  295.      11-12.
  296.  
  297.      STREW requires that the file to be edited  be  on  he  same  drive  as
  298.      its configuration file.
  299.  
  300.  
  301.      INSTALLATION
  302.  
  303.      STREW  is  compileable,  and except for testing changes, should be run
  304.      compiled rather than interpreted.  The interpreted version can  easily
  305.      experience  long  delays  as  garbage  string  space is reclaimed.  If
  306.      you are using the compiled version type in "STREW" to run the program.
  307.      For  the  interpreted  version, type "BASICA /s:512 STREW".  The first
  308.      thing you should do is set up the configuration for your applications:
  309.      especially  the  drive  identifiers  if you are going to use STREW for
  310.      RBBS.
  311.  
  312.  
  313.      RUNNING STREW
  314.  
  315.      In its compiled form, STREW will accept parameters with the DOS prompt.
  316.      At DOS the format is 
  317.  
  318.                         STREW <FILE> <option>
  319.  
  320.      where the file is "RBBS" to do an RBBS strew, or the file to be strewed.
  321.      By specifying "Q" for the option, STREW  will  automatically  quit  to
  322.      DOS  after  strewing  the  file.   The option has no effect unless the
  323.      file is configured to run batch.  For example
  324.  
  325.                        STREW PLAN.DAT Q
  326.  
  327.      says to strew the file named "PLAN.DAT"  and  to  quit  to  DOS  after
  328.      strewing it.
  329.  
  330.      To  run  STREW  as  a  batch  program rather than interactively, first
  331.      configure a file for STREW.  In the configuration, specify the maximum
  332.      number of lines to be displayed on the screen to be zero.
  333.  
  334.      Where  the  lines  are  to  be strewed can be specified interactively,
  335.      using the full screen editor in STREW, or accepting to default directory
  336.      when all lines go to the same file, or using a field within the records.
  337.      When the last option is used, the strew field must be the first specified
  338.      to be read in and displayed on the screen. 
  339.  
  340.  
  341.      HOW STREW NORMALLY WORKS
  342.  
  343.      The user is initially presented with the options 
  344.  
  345.          R)bbs...S)trew...C)onfigure...Q)uit ([R],S,C,Q)
  346.  
  347.      In all menu choices, the default is shown in brackets  ([x])  and  can
  348.      be  gotten  just by pressing RETURN.   R means to load the upload file
  349.      in RBBS for both editing and strewing.  S means to strew  an  existing
  350.      file  with the option to edit the lines in it.  C means to set certain
  351.      parameters in STREW for a file.
  352.  
  353.      Strew can edit files of any size.  However, it can hold only a limited
  354.      number  of  lines  in  memory.   STREW  will read all it can hold; and
  355.      page in the remaining part of the file after the editing on the current
  356.      part is done.  You can limit the amount STREW reads  it  at  one  time
  357.      if  you  find it convenient to work with smaller portions of the file.
  358.      Just specify the maximum number of screens of data to hold  in  memory
  359.      at a time in the configuration.
  360.  
  361.      A full screen of entries from a file is presented.  The editing commands
  362.      that  can then be used are very similar to the editor in BASIC, except
  363.      that the data is divided into fields.  For strewing, the user basically
  364.      assigns the lines to directories by placing identifiers for the  files
  365.      to strew to in the far left field.  The identifier is used as a suffix
  366.      attached to a filename which the user  specifies.   The  RBBS  prefix,
  367.      for  example,  is  usually  DIR.   A  line can be strewed to more than
  368.      one file by separating the  identifiers  by  a  comma.   For  example,
  369.      to  specify  that an entry is to be written to DIR1, DIR21, and DIR98,
  370.      enter in the leftmost field
  371.  
  372.                                 1,21,98
  373.  
  374.      The number of spaces reserved on the screen  for  files  to  strew  to
  375.      can be fixed in the configuration.  The user can specify which displayed
  376.      fields  are  to  be  editable.   Non-editable fields cannot be reached
  377.      by moving the cursor around on the screen.   Page  Up  and  Page  Down
  378.      take  the  user forward and back a screen.  When done specifying where
  379.      the lines are to be strewed to and changing the contents, press Escape.
  380.  
  381.      In RBBS mode the format of lines presented on the screen is
  382.  
  383.          <directory #'s> <filename> <date uploaded> <description>
  384.  
  385.      The size of the file is not displayed, but it is read in  and  written
  386.      out.
  387.  
  388.  
  389.      CONFIGURING STREW
  390.  
  391.      STREW  has  to know three things:  how to read in a file, what editing
  392.      to allow on the file read in, and how to output the file.  The operating
  393.      parameters for each file to be edited are  stored  separately.   Strew
  394.      reserves  the  extension  "STW" for its configuration file.  Hence the
  395.      files to edit must  have  distinct  prefixes.   File  "TEST.DAT"  will
  396.      have  its  strew  configuration  stored  in  "TEST.STW".  For RBBS the
  397.      configuration is not associated with the name of the file to be edited,
  398.      but instead is stored in "RBBS.STW".  You do  not  have  to  configure
  399.      a  file  before  trying  to strew it.  STREW will detect that there is
  400.      no configuration and give you the chance to create it.
  401.  
  402.      Everything is parameterized in STREW, making  it  easy  for  the  user
  403.      to specify the operating constants, such as a default file for entries
  404.      to be written to, the number of lines displayed  on  the  screen,  and
  405.      the  help  description  to  be  associated with each directory for use
  406.      with RBBS.
  407.  
  408.      To run the configuration, just choose  option  C  on  the  main  menu.
  409.      You  will  then  be  prompted for the file name you want to configure.
  410.      To set up STREW for use with RBBS, reply  "RBBS".   For  other  files,
  411.      just give the prefix of the name of the file (no extension).
  412.  
  413.      If  a  previous  configuration  exists  for that file, STREW will read
  414.      it in and allow you to edit and  replace  it.   If  none  exists,  you
  415.      will  be  given  the  option  to  read in another file's configuration
  416.      to use as a basis for the  new  one.   A  default  configuration  will
  417.      be provided if no other basis is used.
  418.  
  419.  
  420.      GENERAL STREW CONFIGURATION
  421.  
  422.      The  parameters  used  for a file with the "S" option on the main menu
  423.      are as follows.
  424.  
  425.      1.   Number of columns of data to read.   Number  of  fields  to  read
  426.      from  the  input  file.   Up to 99 fields.  However, one field must be
  427.      used to specify where to strew line to.  If the  strew  field  is  not
  428.      read from the file, only 98 fields can be read from the file.
  429.  
  430.      2.   Default  suffix  to strew to.  The file to strew to is determined
  431.      by appending the value in the strew field to the  strew  file  prefix.
  432.      For  example,  appending  suffix  "1" to prefix "STRU" to get "STRU1".
  433.      The default suffix is what will be used  if  no  other  is  specified.
  434.      This  will  be  displayed  in  the  strew field if it is not read from
  435.      the file.
  436.  
  437.      3.   Maximum lines per screen.  How many lines of data will be displayed
  438.      on the screen.  Up to 20.  If you specify 0 lines, the file you specify
  439.      will be automatically strewed according  to  the  directions  in  your
  440.      configuration,  and  the  lines  will  not be displayed on the screen.
  441.      This implies that all lines are  a  pre-specified  file  -  determined
  442.      by  the  default  suffix if the strew field is not read from the file,
  443.      otherwise by the value in the strew  field.   This  is  most  valuable
  444.      when  simply  reformatting an entire file, and makes STREW a good tool
  445.      in regular production runs where the same processing is  done  period-
  446.      ically.
  447.  
  448.      4.   Maximum  number  of  screens  of data.  STREW will hold in memory
  449.      more data than it can display on the screen at  any  one  time.   This
  450.      is  the  maximum  number  of  screens  of data it is to hold in memory
  451.      at one time.  There is a real maximum  which  depends  on  the  number
  452.      of fields, but you can specify fewer than this.
  453.  
  454.      5.   Prefix  of  files to strew to.  A string of 7 characters or less.
  455.      Must be a valid file name.  Value in strew field is appended to prefix
  456.      to determine where line is strewed to.
  457.  
  458.      6.   Length  of  field  identifying  strew  (at least 1).  Can specify
  459.      that a line is to strewed to more  that  one  file.   Separate  values
  460.      by  a  comma.   For  example, to strew a line to A and B, put in "A,B"
  461.      in the strew field.  The strew is always the  leftmost  field  of  any
  462.      line.   When  strew  field  is  read from the file, a legal value must
  463.      be put in but it will be ignored in favor of the length of  the  strew
  464.      field.
  465.  
  466.      7.   Whether  read  strew  field  from  the  file.  The value used for
  467.      strewing can be in the file read in, or can  be  an  additional  field
  468.      added  on  the  screen.   The  strew  field is always displayed on the
  469.      far left of each line, and when read  from  the  file  must  therefore
  470.      be the first specified in the fields to be read.
  471.  
  472.      8.   Whether output field is fixed length or variable.  The difference
  473.      is that when fixed length, each field will  be  filled  to  the  right
  474.      if  its  edited  length  is shorter than the maximum field length, and
  475.      if variable length, each field will be written out exactly  as  edited
  476.      with  no  characters  added.   Each  fixed  length field therefore has
  477.      its maximum length on the screen be its actual length when written.
  478.  
  479.      9.   Field separator.  A string to be  inserted  between  each  field.
  480.      This  can  be  any  string,  including  the null (empty) string, which
  481.      amounts to nothing being  inserted.   Some  strings  have  no  natural
  482.      way  of  being  displayed  on the screen, such as a carriage return or
  483.      line feed.  These will be shown as  "<CR>"  and  "<LF>"  respectively.
  484.      To  distinguish  a  space  from  nothing,  a single space will display
  485.      as "<sp>" and an empty separator will  be  shown  as  "<none>".   When
  486.      specifying  the  characters  in  a  string, those that cannot be typed
  487.      by striking a key (the ASCII characters that do  not  have  keys)  can
  488.      be  entered  by  holding  down  the  alt key and tapping out the ASCII
  489.      numeric code using the numeric  keypad.   For  example,  to  get  just
  490.      line  feed  as  a  separator,  hold  down alt while pressing 1 then 0,
  491.      and release alt (10 is the numeric  code  for  line  feed).   See  the
  492.      IBM BASIC manual for a list of the numeric codes and how these characters
  493.      will  be  displayed  on  the  screen.   The default field separator is
  494.      none.
  495.  
  496.      10.  Record separator.  This is a string to be  inserted  at  the  end
  497.      of  each  line  written  out.   Entered  same  way as field separator.
  498.      The standard record separator for text  files  (those  you  can  type,
  499.      read, and print - the standard characters you see on typewriter keyboards)
  500.      is  a  carriage  return  followed  by a line feed (ASCII 13,10).  This
  501.      is the default record separator.
  502.  
  503.      Each field read in from the input field  requires  that  7  additional
  504.      parameters  be  specified.   The  fields  read in will be displayed on
  505.      the screen in the same order they are specified.  Enter  these  fields
  506.      just as you want to see them on the screen.  The parameters are
  507.  
  508.      11.  Title.   This  is  the  column  label to be displayed as a header
  509.      for the field.  Each field is displayed in a  column  on  the  screen,
  510.      with  the  same field from different lines displayed underneath:  just
  511.      like in a spreadsheet.  This can be a maximum of 10 characters.
  512.  
  513.      12.  Width.  The maximum width of  the  column  used  to  display  the
  514.      field  on  the  screen.   Also,  the maximum length the field can have
  515.      when written out.  Need not be the same size as  the  input  field  in
  516.      the file read.
  517.  
  518.      13.  Whether  field  is  editable.   If editable, you are permitted to
  519.      change what is in the field from what is read in.   If  not  editable,
  520.      the field will be displayed but you cannot change it.
  521.  
  522.      14.  Starting  position  of  field in input record.  Each input record
  523.      is assumed to consist of a series  of  characters,  with  each  record
  524.      (or  line)  being separated by a carriage-return line-feed.  The field
  525.      is assumed to start in the same position in each record.   The  fields
  526.      are displayed on the screen in the order they are entered.  For example,
  527.      if  you  want  the  third field in the input record to be displayed in
  528.      the first column, specify the beginning  column  of  the  third  field
  529.      for the first entry.
  530.  
  531.      15.  Number  of characters in field in input record.  Each input field
  532.      is assumed to have the same length.
  533.  
  534.      16.  Order fields are to be written out.   The  fields  displayed  can
  535.      be  written out in any order.  You must distinguish the order in which
  536.      the fields occur in the input record from the order they are displayed
  537.      on  the  screen  and  from the order they are written out.  This field
  538.      specifies which order the fields displayed on the  screen  are  to  be
  539.      written  out.   You  can  therefore rearrange the output fields in any
  540.      way desired.  You may want to display some fields on  the  screen  but
  541.      not  write  them  out.   For  such  fields specify the output order to
  542.      be zero (0).  The value 1 means that this is the first field to output,
  543.      2 the second, 3 the third, etc.
  544.  
  545.      17.  Whether field is to be put  inside  double  quotes  when  written
  546.      out.   You  will  often  want  to  read the data into another program,
  547.      and many programs insist  that  text  be  distinguished  from  numbers
  548.      by  being  enclosed  in  quotes.   Also,  if embedded spaces can occur
  549.      inside a text field, the entire field must often be enclosed in quotes
  550.      in order to be read properly.
  551.  
  552.  
  553.      RBBS CONFIGURATION
  554.  
  555.      The parameters for use with RBBS are as follows:
  556.  
  557.      1.   RBBS  file  to  be edited.  Name of file that contains line items
  558.      which are to be dispersed by  appending  to  various  files.   If  you
  559.      don't  want  a  fixed  file  and would prefer to specify the file each
  560.      time you invoke option R, make this entry empty.
  561.  
  562.      2.   Drive containing RBBS directory files, which  are  the  files  to
  563.      be appended to.
  564.  
  565.      3.   Drive(s)  containing  RBBS  uploaded  files.  These are where the
  566.      files are located that are listed in the RBBS file to be edited.
  567.  
  568.      4.   Name of file of skipped lines.  STREW tries to identify  comments
  569.      in  the  RBBS  file to be edited.  Any lines it identifies as not file
  570.      entries are skipped and are written to this file.   The  operator  can
  571.      then  view  the  skipped  lines  to  see whether they should have been
  572.      skipped.
  573.  
  574.      5.   Default RBBS directory suffix of  files  that  lines  are  to  be
  575.      written to.  Set to file that you put most of your lines in.
  576.  
  577.      6.   Maximum  number  of  lines  you  want displayed on a page (1-20).
  578.  
  579.      7.   Maximum number of pages of lines that you  want  held  in  memory
  580.      at  any  time  for editing.  There is only so much room in the program
  581.      in arrays to store such information.   The  maximum  number  of  lines
  582.      that  will  be  read  in is item 6 times item 7.  STREW tracks whether
  583.      it has finished reading to file to be edited and  will  swap  in  more
  584.      pieces  of  it after the current piece is edited and saved.  Currently
  585.      you can move only forward through a file.  Once  a  piece  of  a  file
  586.      is  processed,  you  cannot  back  up (because once a file is strewed,
  587.      there is no recovery).
  588.  
  589.      8.   Prefix to be used to name files that are appended  to.   Normally
  590.      "DIR" in RBBS.
  591.  
  592.      9.   Length  of  space  reserved  on  screen  for specifying number of
  593.      files to strew to.  Limits number of  files  that  can  be  specified.
  594.      STREW  accepts  only  the  numbers 1-99 for such entries, and multiple
  595.      entries must be separated by a comma.
  596.  
  597.      10.  Whether want to be in insert or replace  mode  when  first  enter
  598.      editor.  Use Insert key to toggle between.
  599.       
  600.      11.  A  short  12  character  phrase  to  be associated with the files
  601.      appended to:  up to 99 such entries.  Used with Alt-D  as  a  reminder
  602.      of what types of entries are stored in each directory.  
  603.  
  604.  
  605.  
  606.      THE EDITING COMMANDS
  607.  
  608.  
  609.      <BACKSPACE>   - Delete character to left of cursor and close text
  610.  
  611.      DEL           - Delete character at cursor and close text
  612.  
  613.      <RETURN>           - Go to next field (to right; if at far right, goes
  614.                      down a line to field at far left)
  615.  
  616.      HOME          - Go to top left corner field of screen.
  617.  
  618.      <UP ARROW>     Go up a line; keep in same field but go to first column
  619.                     position.
  620.  
  621.      <DOWN ARROW>  - Go down a line; keep in same field.
  622.  
  623.      PgUp           Go  up  a  page.   Stay  on same relative entry.  If on
  624.                     first page, go to last page.
  625.  
  626.      PgDn           Go down a page.   Stay  on  same  relative  entry.   If
  627.                     on last page, go to first page.
  628.  
  629.      Ins               - Toggles between Insert and Replace modes.  Default
  630.                      mode is replace.
  631.  
  632.      End           - Go to far right of current field.
  633.  
  634.      <Tab>          Jump forward.  If currently at far left editable field,
  635.                     goes  to  far  right  editable  field.  If currently at
  636.                     far right editable field,  goes  down  a  line  to  far
  637.                     left  editable  field.   In RBBS mode Tab-Tab therefore
  638.                     advances the user through  the  fields  that  are  most
  639.                     often  edited  -  from  the  files  to write to, to the
  640.                     description, to the files to  write  to  for  the  next
  641.                     line, etc.  
  642.  
  643.      Alt-D          Gives list of all 99 directory files with a user-supplied
  644.                     description  of up to 12 characters.  Use for reviewing
  645.                     what numbers to associate with  what  files.   For  use
  646.                     only with RBBS.
  647.  
  648.      Alt-V          View  file  currently  positioned  on.  Applies only in
  649.                     RBBS mode.  May need  to  view  information  to  decide
  650.                     where to strew files to.  You can view any file, although
  651.                     executable files will look very strange on the screen.
  652.  
  653.  
  654.  
  655.      USING STREW WITH RBBS
  656.  
  657.      Strew  comes  preconfigured  with  an  option to help sysops using the
  658.      host program Remote Bulletin Board System (RBBS) to manage  the  files
  659.      uploaded.   To  configure  STREW for RBBS, select option C on the main
  660.      menu and then use "RBBS" for the file to configure.
  661.  
  662.      Strew will correctly read the file format  in  all  versions  of  RBBS
  663.      from  12.1  or  higher.   Strew  will write out the format in the form
  664.      that the new ("N") command expects.
  665.  
  666.      Many sysops put comment text in directories.  Strew will try to detect
  667.      such  lines,  and  will exclude them from the lines to be edited.  The
  668.      user can check to see whether only  comment  lines  were  excluded  by
  669.      inspecting  a  file  where  are  excluded lines are written.  The file
  670.      name is specified in the RBBS configuration.
  671.  
  672.      You may find that STREW includes some  lines  as  filenames  that  are
  673.      really  comments.   You  can prevent such lines from being written out
  674.      or strewed simply by removing all  characters  from  the  strew  field
  675.      that  specifies  where  to  strew  the  line to.  An empty strew is no
  676.      strew.  A better permanent solution is  to  change  the  comment  line
  677.      so that STREW will properly interpret it as a comment.  You can either
  678.      (a) make the comment line 32 characters or fewer, or (b) put a non-blank
  679.      character in columns 22, 23, or 13.
  680.  
  681.      Some sysops in one single directory have sub-lists grouped  by  topic.
  682.      For  example,  programming  aids  may be divided by language in BASIC,
  683.      TURBO PASCAL, and C.  Strewing all  related  files  to  the  end  will
  684.      then  not  place  the  file  in its proper sublist.  Strew can be used
  685.      with sublists by maintaining each sublist as a separate working directory
  686.      with its header at the top, strewing to each working  directory,  then
  687.      copying  all  the  working  directories together.  A single batch file
  688.      could automate the entire process.  For example, dir38 could  be  used
  689.      for basic, dir39 for turbo, and dir40 for C.  None of these directories
  690.      are  listed  in  the  master directory.  Instead there is only a dir15
  691.      called "Programming Aids".  Then let STREW be invoked by the following
  692.      batch file.
  693.  
  694.                          STREW
  695.                          COPY DIR38+DIR39+DIR40 DIR15
  696.  
  697.      Sysops  who  maintain  sorted  lists  of files by name will find STREW
  698.      to be less useful.   STREW will not  properly  insert  the  new  files
  699.      in the proper order, but instead only appends.  If you have an independent
  700.      sort  routine,  the  file  can  be  resorted after strewing.  A future
  701.      release of strew may support merging the lines  instead  of  appending
  702.      them.
  703.  
  704.      The  records  you  append  may  fail to appear when you type the file.
  705.      There is then a control-Z in your file between  the  appended  records
  706.      and  the  rest  of  the file.  A control-Z is interpreted by DOS as an
  707.      end-of-information mark.  This can happen when you  edit  these  files
  708.      and  save  them.   I do not know exactly what causes this problem, but
  709.      there are filler characters after the  control-Z  that  apparently  do
  710.      not have a proper length, so that BASIC in its append mode misinterpretes
  711.      where the file ends and appends after rather than before the control-Z.
  712.      Append  will  work  properly  when  the  last character in the file is
  713.      a control-Z with no  filler;  and  sometimes  when  there  is  filler.
  714.      Either  let  BASIC  create  these files and never change their length,
  715.      or use a text editor that ignores the  control-Z  and  lets  you  edit
  716.      all characters in the file (remove the filler after the control-Z).
  717.  
  718.  
  719.      MODIFYING STREW
  720.  
  721.      The  source  code for STREW is provided so that users can easily track
  722.      down problems they find in the program or add enhancements  that  they
  723.      need.   The  IBM BASIC compiler is needed if anything other than small
  724.      data sets are to be used.  The interpreter is most useful for  testing
  725.      modifications.
  726.  
  727.      STREW  can  easily  be  modified  to  allow more than 99 fields.  Just
  728.      change all of the occurences of 99  to  the  larger  number  near  the
  729.      beginning  of  the  program.   The maximum number of lines allowed can
  730.      also be expanded by increasing the size  of  the  dimension  statement
  731.      for array E$.
  732.  
  733.      STREW uses an embedded assembler program to get passed DOS parameters.
  734.      This code will not run properly under the  interpreter  and  therefore
  735.      is  commented  out  in  the source code.  Whenever you want to compile
  736.      the program, you must therefore  restore  the  line  by  removing  the
  737.      single quote at the beginning.
  738.  
  739.      The  IBM  BASIC  and  its  compiler have severe limitations which make
  740.      it a frustrating programming  language.   Advanced  DOS  features  are
  741.      not  supported,  screen  input/output  is  very sluggish, the compiler
  742.      does not support all features available  in  the  interpreter,  string
  743.      space  is  very  wastefully  used  and poorly reclaimed, and there are
  744.      no true  subprograms  with  passed  parameters  and  local  variables.
  745.      The  author has had to do many things to optimize the code which would
  746.      not have to be done in a better  designed  language.   In  many  cases
  747.      this made the code less straight forward and more difficult to follow.
  748.      Another language would definitely had been used if  the  product  were
  749.      sold  commercially,  but  IBM  BASIC  was still used because it is the
  750.      only programming language widely available in the user community.
  751.      An external assembler program was used to  change  the  speed  of  the
  752.      full screen display from slow to fast.
  753.  
  754.      The  source  code is supplied in the form for running under the inter-
  755.      preter.  Two lines in it have to be changed when  compiling.   In  one
  756.      a comment is added at the beginning of a line and in another a beginning
  757.      comment  is  removed.   These  lines  are noted by comments in the the
  758.      code.
  759.  
  760.      The author keeps the source code on drive B and the compiler on  drive
  761.      A.  The following batch file does the compiling and linking.
  762.  
  763.                A:BASCOM B:STREW /E/W/S/O,B:STREW,B:NUL.LST 
  764.                A:LINK B:STREW+B:QPRINT,B:STREW,B:NUL.MAP,A: 
  765.